package com.jservice.web.sysRole;


import com.jfinal.core.Controller;
import com.jservice.framework.dto.Message;
import com.jservice.web.base.JBaseValidator;

public class RoleValidator extends JBaseValidator {

	@Override
	protected void handleError(Controller controller) {

		controller.setAttr("message", Message.error(controller.getAttr("message")));
		controller.render("/admin/index/error.html");
	}

	@Override
	protected void validate(Controller controller) {

		validateRequired("sysRole.name", "message", "不得为空");
		validateRequired("sysRole.is_system", "message", "不得为空");
		validateRequired("permissions", "message", "不得为空");
	}

}
